package com.lantu.pojo.user;

import com.lantu.core.entity.User;
import com.lantu.utils.BeanUtils;
import lombok.Data;

import java.util.Date;

@Data
public class LoginUser {
    private String id;
    private String username;
    private String avatar;

    private String ip;

    private Date lastLoginTime;

    private String token;

    public static LoginUser newInstance(User user, String token) {
        LoginUser loginUser = BeanUtils.toBean(user, LoginUser.class);
        loginUser.setToken(token);
        return loginUser;
    }
}
